package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppGroupUserMapper;
import com.ruoyi.system.domain.AppGroupUser;
import com.ruoyi.system.service.IAppGroupUserService;

import javax.annotation.Resource;

/**
 * 群组成员Service业务层处理
 *
 * @author ruoyi
 * @date 2023-02-27
 */
@Service
public class AppGroupUserServiceImpl extends ServiceImpl<AppGroupUserMapper, AppGroupUser> implements IAppGroupUserService {
    @Resource
    private AppGroupUserMapper appGroupUserMapper;

    /**
     * 查询群组成员
     *
     * @param id 群组成员主键
     * @return 群组成员
     */
    @Override
    public AppGroupUser selectAppGroupUserById(Long id) {
        return appGroupUserMapper.selectAppGroupUserById(id);
    }

    /**
     * 查询群组成员列表
     *
     * @param appGroupUser 群组成员
     * @return 群组成员
     */
    @Override
    public List<AppGroupUser> selectAppGroupUserList(AppGroupUser appGroupUser) {
        return appGroupUserMapper.selectAppGroupUserList(appGroupUser);
    }

    /**
     * 新增群组成员
     *
     * @param appGroupUser 群组成员
     * @return 结果
     */
    @Override
    public int insertAppGroupUser(AppGroupUser appGroupUser) {
        appGroupUser.setCreateTime(DateUtils.getNowDate());
        return appGroupUserMapper.insertAppGroupUser(appGroupUser);
    }

    /**
     * 修改群组成员
     *
     * @param appGroupUser 群组成员
     * @return 结果
     */
    @Override
    public int updateAppGroupUser(AppGroupUser appGroupUser) {
        return appGroupUserMapper.updateAppGroupUser(appGroupUser);
    }

    /**
     * 批量删除群组成员
     *
     * @param ids 需要删除的群组成员主键
     * @return 结果
     */
    @Override
    public int deleteAppGroupUserByIds(Long[] ids) {
        return appGroupUserMapper.deleteAppGroupUserByIds(ids);
    }

    /**
     * 删除群组成员信息
     *
     * @param id 群组成员主键
     * @return 结果
     */
    @Override
    public int deleteAppGroupUserById(Long id) {
        return appGroupUserMapper.deleteAppGroupUserById(id);
    }
}
